<?php
	session_start();
	
	$user = 'root';
	$password = 'root';
	$datasource = 'mysql:host=localhost;dbname=blog;charset=utf8';
	$base = new PDO ($datasource,$user,$password);
	
	$result = $base->prepare('UPDATE utilisateur SET actif=0 WHERE id=\''.$_SESSION['id'].'\'');
	if($result->execute()){
		echo "";
	}else{
		var_dump($_SESSION);
	}
	
	UNSET($_SESSION['login'])		;
	UNSET($_SESSION['id'])			;
	UNSET($_SESSION['nom'])		;
	UNSET($_SESSION['prenom'])		;
	UNSET($_SESSION['id_droit'])	;

	session_destroy();
	header('location:../vue/index.php');
?>